#pragma once
#include "vtkslicermodulegui.h"
#include <string>
#include "EndoscopeLogic.h"
#include "vtkKWRenderWidget.h"
class vtkVirtualDisplayWidget;
class vtkEndoscopeWidget;
class vtkKWMultiColumnListWithScrollbars;
class vtkSlicerViewerWidget;
class  /*__declspec( dllexport )*/  EndoscopeGUI :
	public vtkSlicerModuleGUI
{
public:
	// Description:
	// Usual vtk class functions
	static EndoscopeGUI* New (  );
	vtkTypeRevisionMacro ( EndoscopeGUI, vtkSlicerModuleGUI );
	void PrintSelf ( ostream& os, vtkIndent indent );

	// Description:
	// Get methods on class members (no Set methods required.)
	//vtkGetObjectMacro ( Logic, vtkSlicerDataLogic);
	//vtkGetObjectMacro ( MRMLNode, vtkMRMLNode );

	// Description:
	// API for setting MRMLNode, Logic and
	// for both setting and observing them.
	/*
	// classes not yet defined!
	void SetMRMLNode ( vtkMRMLNode *node )
	{ this->SetMRML ( vtkObjectPointer( &this->MRMLNode), node ); }
	void SetAndObserveMRMLNode ( vtkMRMLNode *node )
	{ this->SetAndObserveMRML ( vtkObjectPointer( &this->MRMLNode), node ); }

	void SetModuleLogic ( vtkSlicerDataLogic *logic )
	{ this->SetLogic ( vtkObjectPointer (&this->Logic), logic ) }
	void SetAndObserveModuleLogic ( vtkSlicerDataLogic *logic )
	{ this->SetAndObserveLogic ( vtkObjectPointer (&this->Logic), logic ) }
	*/

	// Description:
	// Methods for adding module-specific key bindings and
	// removing them.
	virtual void CreateModuleEventBindings ( );
	virtual void ReleaseModuleEventBindings ( );

	// Description:
	// This method builds the Data module's GUI
	virtual void BuildGUI ( ) ;

	// Descripgion:
	// This method releases references and key-bindings,
	// and optionally removes observers.
	virtual void TearDownGUI ( );

	// Description:
	// Add/Remove observers on widgets in the GUI
	virtual void AddGUIObservers ( );
	virtual void RemoveGUIObservers ( );

	// Description:
	// Class's mediator methods for processing events invoked by
	// either the Logic, MRML or GUI.
	virtual void ProcessLogicEvents ( vtkObject *caller, unsigned long event, void *callData );
	virtual void ProcessGUIEvents ( vtkObject *caller, unsigned long event, void *callData );
	virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData );

	// Description:
	// Describe the behavior at module enter and exit.
	virtual void Enter ( );
	virtual void Exit ( );
	void SetAndObserveESLogic(EndoscopeLogic * logic);
	void SetESLogic(EndoscopeLogic * logic);
	vtkGetObjectMacro(EndoscopeView, vtkEndoscopeWidget);
	vtkGetObjectMacro(EndoscopeIP, vtkKWUserInterfacePanel);
	vtkGetObjectMacro(ESLogic, EndoscopeLogic);
	vtkGetObjectMacro(ReportMultiColumnList, vtkKWMultiColumnListWithScrollbars);
	vtkGetObjectMacro(VirtualDisplayWidget, vtkVirtualDisplayWidget);
protected:
	EndoscopeGUI ( );
	virtual ~EndoscopeGUI ( );
	vtkEndoscopeWidget * EndoscopeView;
	vtkVirtualDisplayWidget * VirtualDisplayWidget;
	vtkKWUserInterfacePanel * EndoscopeIP;
	EndoscopeLogic * ESLogic;
	std::string TimerID;



private:
	EndoscopeGUI ( const EndoscopeGUI& ); // Not implemented.
	void operator = ( const EndoscopeGUI& ); //Not implemented.
	vtkKWPushButton * TestButton;
	vtkKWPushButton * CaptureStartButton;
	vtkKWPushButton * CaptureStopButton;
	vtkKWPushButton * OpenDeviceButton;
	vtkKWPushButton * CloseDeviceButton;
	vtkKWPushButton * AurorerInitialButton;
	vtkKWPushButton * StartTrackingButton;
	vtkKWPushButton * StopTrackingButton;
	vtkKWLabel * FrameFrequencyLabel;
	vtkKWMultiColumnListWithScrollbars * ReportMultiColumnList;

	vtkKWPushButton * CalibrationBeginButton;
	vtkKWPushButton * CalibrationStopButton;
	vtkKWLabel * SampleNumLabel;
	vtkKWEntryWithLabel * XOffsetEntry;
	vtkKWEntryWithLabel * YOffsetEntry;
	vtkKWEntryWithLabel * ZOffsetEntry;
	vtkKWRenderWidget * EndoscopeWindow1;
	vtkKWRenderWidget * EndoscopeWindow2;
	vtkKWPushButton * TextMappingButton;
	vtkKWPushButton * SaveImageButton;

	vtkSlicerViewerWidget * MySlicerViewerWidget;
};
